<!-- angular通过ng-modal添加模态框时，不需要外层的div，只需从modal-content开始即可 -->
<style>
    
</style>
<div class="modal-content">
    <div class="modal-header">
        <h3 class="modal-title">切换分支</h3>
    </div>
    <form class="modal-body form-horizontal">
        <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-5 radio">
                <label>
                    <input type="radio" name="optionsRadios" value="true" ng-model="info.radioStatus" ng-change="radioChange()" checked>
                    新建工程
                </label>
            </div>
            <div class="col-sm-5 radio">
                <label>
                    <input type="radio" name="optionsRadios" value="false" ng-model="info.radioStatus" ng-change="radioChange()">
                    已有工程
                </label>
            </div>
        </div>
        <div class="line-lg pull-in" style="margin-top: 8px;margin-bottom: 8px;"></div>
        <!-- 新建工程 -->
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">工程：</label>
            <div class="col-sm-10">
                <label class="control-label">{{info.trunkName}}</label>
            </div>
        </div>
        <div class="line-lg pull-in" ng-if="info.radioStatus == 'true'"></div>
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">来源：</label>
            <div class="col-sm-10">
                <select class="form-control" ng-model="info.svn_form">
                    <option value="{{i.name}}" ng-repeat="i in info.proInfo.svn_list">{{i.name}}</option>
                </select>
            </div>
        </div>
        <div class="line-lg pull-in" ng-if="info.radioStatus == 'true'"></div>
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">分支版本：</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" ng-model="info.proInfo.branch_num" ng-change="updateBranch_num()">
            </div>
        </div>
        <div class="line-lg pull-in" ng-if="info.radioStatus == 'true'"></div>
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">项目代码：</label>
            <div class="col-sm-10">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="Recipient's username" ng-model="info.planInfo.plan_code" ng-change="updatePlanCode()">
                    <span class="input-group-addon" ng-click="checkProjectPlanCode()">校验</span>
                </div>
                <div nf-show="info.msg != ''" style="color: #f05050;">{{info.msg}}</div>
            </div>
        </div>
        <div class="line-lg pull-in" ng-if="info.radioStatus == 'true'"></div>
        <div class="form-group" ng-if="info.radioStatus == 'true'">
            <label class="col-sm-2 control-label">目标工程：</label>
            <div class="col-sm-10">
                <label class="control-label">{{info.proInfo.trunk_name}}-{{info.proInfo.branch_num}}.{{info.planInfo.plan_code}}</label>
            </div>
        </div>
        <!-- end 新建工程 -->
        <!-- 已有工程 -->
        <div class="form-group" ng-if="info.radioStatus == 'false'">
            <label class="col-sm-2 control-label">选择：</label>
            <div class="col-sm-10 form-select">
                <select class="form-control" ng-model="info.selectProName">
                    <option ng-repeat="pro in info.proList" value="{{pro.projectName}}">{{pro.projectName}}</option>
                </select>
                <label class="control-label" style="color: #f05050;"><i class="fa fa-exclamation-circle"></i>不能选择主干工程进行切换,如果要使用主干,需要选择"新建工程",然后从主干上创建一个新分支</label>
            </div>
        </div>
        <!-- end 已有工程 -->
    </form>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary" ng-click="saveClick()" ng-disabled="(info.radioStatus == 'true' && info.msg!='') || (info.radioStatus == 'false'&&info.selectProName == info.trunkName)">确定</button>
        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="cancelClick()">取消</button>
    </div>
</div>
